"""Definition of the moviceinfo content type
"""

from zope.interface import implements

from Products.Archetypes import atapi
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-
from my315ok.xtinfocontent import xtinfocontentMessageFactory as _

from my315ok.xtinfocontent.interfaces import Imoviceinfo
from my315ok.xtinfocontent.config import PROJECTNAME

moviceinfoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema((

    # -*- Your Archetypes field definitions here ... -*-

   
#    atapi.StringField(
#        'category',
#        storage=atapi.AnnotationStorage(),
#        vocabulary_factory=u"my315ok.xtinfocontent.classinfocategory",
#        enforceVocabulary=True,
#        widget=atapi.SelectionWidget(
#            label=_(u"category"),
#            description=_(u""),            
#        ),
#    ),    
    
    atapi.TextField(
        'text',
        storage=atapi.AnnotationStorage(),
        default_output_type = 'text/html',
        widget=atapi.RichWidget(
            label=_(u"movice info"),
            description=_(u""),
        ),
        required=True,
    ),


))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

moviceinfoSchema['title'].storage = atapi.AnnotationStorage()
moviceinfoSchema['description'].storage = atapi.AnnotationStorage()
moviceinfoSchema['description'].widget.visible = 0

schemata.finalizeATCTSchema(moviceinfoSchema, moveDiscussion=False)


class moviceinfo(base.ATCTContent):
    """a movices information"""
    implements(Imoviceinfo)

    meta_type = "moviceinfo"
    schema = moviceinfoSchema
    _at_rename_after_creation = True

    title = atapi.ATFieldProperty('title')
    description = atapi.ATFieldProperty('description')

    # -*- Your ATSchema to Python Property Bridges Here ... -*-
#    category = atapi.ATFieldProperty('category')

    text = atapi.ATFieldProperty('text')


atapi.registerType(moviceinfo, PROJECTNAME)
